{extend name="common@base" /}
{block name="content"}
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box box-primary">
        <div class="box-header with-border">
          <div class="box-title">考试管理</div>
          <div class="pull-right">
            <a href="{:url('edit')}" class="btn btn-primary">发起一场考试</a>
          </div>
        </div>
        <div class="box-body">
          <table id="table" class="table">
            <thead>
            <tr>
              <th>ID</th>
              <th>开始时间</th>
              <th>考试时长</th>
              <th>班级</th>
              <th>监考老师</th>
              <th>应考人数 / 实考人数</th>
              <th>通过率</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $rows as $row}
            <tr>
              <td>{$row.id}</td>
              <td>{$row.start_time}</td>
              <td>{$row.exam_duration}分钟</td>
              <td>{$row.class_title ? $row.class_title : "补考"}</td>
              <td>{$row.realname}</td>
              <td>{$row.paper_count} / {$row.examinee_count}</td>
              <td>{$row.pass_rate}</td>
              <td>{$row.statusText}</td>
              <td>
                <a href="{:url('view',['id'=>$row.id])}" class="btn btn-xs btn-default">查看</a>
                {if $row.status==0}
                <a href="{:url('edit',['id'=>$row.id])}" class="btn btn-xs btn-default">编辑</a>
                <a href="{:url('examStart',['id'=>$row.id])}"
                   class="btn btn-xs btn-success js-confirm">考试开始</a>
                {/if}
              </td>
            </tr>
            {/foreach}
            </tbody>
          </table>
        </div>
        <div class="box-footer">
          {$rows->render()}
        </div>
      </div>
    </div>
  </div>
</section>
{/block}
{block name="page_script"}
<script>
  require(["layer_config", "ajaxForm"], function (layer) {
  });
</script>
{/block}





